<template>
	<view>
		<u-form :model="form">
			<u-form-item label="姓名">
				<u-input v-model="form.name"></u-input>
			</u-form-item>
			<u-form-item label="标题">
				<u-input type="textarea" v-model="form.title"></u-input>
			</u-form-item>
			<u-form-item label="内容">
				<u-input type="textarea" v-model="form.content"></u-input>
			</u-form-item>
		</u-form>
		<u-upload></u-upload>
		<button class="bu" style="margin-top: 40rpx;" :disabled="form.name === '' || form.title === '' || form.content === '' ? true : false" @click="submit">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					name: '',
					title: '',
					content: ''
				}
			};
		},
		methods:{
			submit(){
				uni.showToast({
					title:'提交成功'
				})
				this.$historyList.unshift(this.form)
				console.log(this.$historyList)
				setTimeout(() => {
					uni.switchTab({
						url:'/pages/old/old'
					})
				}, 1000)
			}
		},
		onNavigationBarButtonTap() {
			uni.navigateTo({
				url:'/pages/history-advice/history-advice'
			})
		}
	}
</script>

<style lang="scss">
view{
	padding: 20rpx;
}
</style>
